Optimal. Leaf size=30 \[ -\frac {x^2}{2}+\frac {\log (\cos (a+b x))}{b^2}+\frac {x \tan (a+b x)}{b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {3801, 3556, 30}
\begin {gather*} \frac {\log (\cos (a+b x))}{b^2}+\frac {x \tan (a+b x)}{b}-\frac {x^2}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 3556
Rule 3801
Rubi steps
\begin {align*} \int x \tan ^2(a+b x) \, dx &=\frac {x \tan (a+b x)}{b}-\frac {\int \tan (a+b x) \, dx}{b}-\int x \, dx\\ &=-\frac {x^2}{2}+\frac {\log (\cos (a+b x))}{b^2}+\frac {x \tan (a+b x)}{b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.21, size = 43, normalized size = 1.43 \begin {gather*} -\frac {x^2}{2}+\frac {\log (\cos (a+b x))}{b^2}+\frac {x \sec (a) \sec (a+b x) \sin (b x)}{b}+\frac {x \tan (a)}{b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 40, normalized size = 1.33
method | result | size |
norman | \(\frac {x \tan \left (b x +a \right )}{b}-\frac {x^{2}}{2}-\frac {\ln \left (1+\tan ^{2}\left (b x +a \right )\right )}{2 b^{2}}\) | \(34\) |
default | \(-\frac {x^{2}}{2}+\frac {\left (b x +a \right ) \tan \left (b x +a \right )+\ln \left (\cos \left (b x +a \right )\right )-a \tan \left (b x +a \right )}{b^{2}}\) | \(40\) |
risch | \(-\frac {x^{2}}{2}-\frac {2 i x}{b}-\frac {2 i a}{b^{2}}+\frac {2 i x}{b \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )}+\frac {\ln \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )}{b^{2}}\) | \(57\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 214 vs.
\(2 (28) = 56\).
time = 0.53, size = 214, normalized size = 7.13 \begin {gather*} \frac {2 \, {\left (b x + a - \tan \left (b x + a\right )\right )} a - \frac {{\left (b x + a\right )}^{2} \cos \left (2 \, b x + 2 \, a\right )^{2} + {\left (b x + a\right )}^{2} \sin \left (2 \, b x + 2 \, a\right )^{2} + 2 \, {\left (b x + a\right )}^{2} \cos \left (2 \, b x + 2 \, a\right ) + {\left (b x + a\right )}^{2} - {\left (\cos \left (2 \, b x + 2 \, a\right )^{2} + \sin \left (2 \, b x + 2 \, a\right )^{2} + 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1\right )} \log \left (\cos \left (2 \, b x + 2 \, a\right )^{2} + \sin \left (2 \, b x + 2 \, a\right )^{2} + 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) - 4 \, {\left (b x + a\right )} \sin \left (2 \, b x + 2 \, a\right )}{\cos \left (2 \, b x + 2 \, a\right )^{2} + \sin \left (2 \, b x + 2 \, a\right )^{2} + 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1}}{2 \, b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 38, normalized size = 1.27 \begin {gather*} -\frac {b^{2} x^{2} - 2 \, b x \tan \left (b x + a\right ) - \log \left (\frac {1}{\tan \left (b x + a\right )^{2} + 1}\right )}{2 \, b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.08, size = 41, normalized size = 1.37 \begin {gather*} \begin {cases} - \frac {x^{2}}{2} + \frac {x \tan {\left (a + b x \right )}}{b} - \frac {\log {\left (\tan ^{2}{\left (a + b x \right )} + 1 \right )}}{2 b^{2}} & \text {for}\: b \neq 0 \\\frac {x^{2} \tan ^{2}{\left (a \right )}}{2} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 182 vs.
\(2 (28) = 56\).
time = 0.70, size = 182, normalized size = 6.07 \begin {gather*} -\frac {b^{2} x^{2} \tan \left (b x\right ) \tan \left (a\right ) - b^{2} x^{2} + 2 \, b x \tan \left (b x\right ) + 2 \, b x \tan \left (a\right ) - \log \left (\frac {4 \, {\left (\tan \left (b x\right )^{4} \tan \left (a\right )^{2} - 2 \, \tan \left (b x\right )^{3} \tan \left (a\right ) + \tan \left (b x\right )^{2} \tan \left (a\right )^{2} + \tan \left (b x\right )^{2} - 2 \, \tan \left (b x\right ) \tan \left (a\right ) + 1\right )}}{\tan \left (a\right )^{2} + 1}\right ) \tan \left (b x\right ) \tan \left (a\right ) + \log \left (\frac {4 \, {\left (\tan \left (b x\right )^{4} \tan \left (a\right )^{2} - 2 \, \tan \left (b x\right )^{3} \tan \left (a\right ) + \tan \left (b x\right )^{2} \tan \left (a\right )^{2} + \tan \left (b x\right )^{2} - 2 \, \tan \left (b x\right ) \tan \left (a\right ) + 1\right )}}{\tan \left (a\right )^{2} + 1}\right )}{2 \, {\left (b^{2} \tan \left (b x\right ) \tan \left (a\right ) - b^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.11, size = 35, normalized size = 1.17 \begin {gather*} -\frac {\frac {\ln \left ({\mathrm {tan}\left (a+b\,x\right )}^2+1\right )}{2}-b\,x\,\mathrm {tan}\left (a+b\,x\right )}{b^2}-\frac {x^2}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________